﻿
CREATE PROCEDURE [dbo].[proc_LoginUser]
	(
		@UserName nvarchar(50),
		@SearchText nvarchar(50),
		@type nvarchar(50)
	)
AS
begin
	SELECT [Name] AS EName,
	ISNULL((SELECT c.CompanyName FROM Company c WHERE c.Id=[aspnet_Users].CompanyId),'') AS CompanyName,
ISNULL((SELECT d.DName FROM Department d WHERE d.Id=[aspnet_Users].DepartmentId),'') AS DepartmentName,
CompanyId,UserName,DepartmentId

FROM [aspnet_Users] WHERE IsDelete = 0 AND IsLockout=0 AND [NAME] LIKE '%'+@SearchText+'%'  AND cid=''
		
		

end
	RETURN

